import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data,
    meta: {
      globalWarn: false
    }
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-element-admin/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-element-admin/user/logout',
    method: 'post'
  })
}

// 修改密码
export function modifyPwd(data) {
  return request({
    url: '/user/modifyUserPwd',
    method: 'post',
    data
  })
}

// 获取验证码
export function getVerifyCode(params) {
  return request({
    url: '/user/verifyCode',
    method: 'get',
    params
  })
}
